package a08_1;

import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

@Component //默认是单例
public class E {


    @Lazy
    @Autowired
    public F1 f1;

    @Autowired
    public F2 f2;

    @Autowired
    public ObjectFactory<F3> objectFactory;

    @Autowired
    private ApplicationContext context;



    public F1 getF1() {
        return f1;
    }



    public F2 getF2() {
        return f2;
    }


    public F3 getF3() {

        return objectFactory.getObject();
    }

    public F4 getF4() {
        return context.getBean(F4.class);
    }
}
